package top.hg.tool.modules.car.bidding;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import top.hg.tool.common.util.R;

import java.util.List;

/**
 * @Author: skh
 * @Date: 2019/7/30 10:33
 * @Description:
 */
@RestController
@RequestMapping("/car")
@Api(value = "竞价管理")
@Slf4j
public class BiddingController {

    @Autowired
    private BiddingService biddingService;

    @ApiOperation("新增竞价期数")
    @PostMapping("/saveBidding")
    public R saveBidding(@RequestBody BiddingEntity biddingForm) {
        biddingService.saveBidding(biddingForm);
        return R.success();
    }

    @ApiOperation("获取个人竞价列表")
    @GetMapping("/getPersonBiddingList")
    public R getPersonBiddingList() {
        List<BiddingEntity> biddingEntityList = biddingService.getPersonBiddingList();
        return R.success(biddingEntityList);
    }

    @ApiOperation("获取公司竞价列表")
    @GetMapping("/getCompanyBiddingList")
    public R getCompanyBiddingList() {
        List<BiddingEntity> biddingEntityList = biddingService.getCompanyBiddingList();
        return R.success(biddingEntityList);
    }
}
